home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 32
/
032.d81
/
dragon chase
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
148 lines
5 poke55,255:poke56,47
10 ifpeek(12288)<>0orpeek(12289)<>0thenload"dragon.spr",8,1
20 ifpeek(14336)<>60orpeek(14337)<>102thenload"dragon.fnt",8,1
30 dim s$(4),s(5):tr$="uv[157][157][149]wx"
35 d$="[144]ab[157][157][157][157][157][157]tcdef[157][157][157][157][157][157]ghijklm[157][157][157][157][157][157][157]nopqrs"
40 v=53248:sc=0:lv=3:tm=2500:hs=0:p1=193:p2=195:lp=1
50 s$(0)="":forl=1to4:s$(l)=s$(l-1)+"":next
60 forl=0to5:s(l)=l*5+2:next
70 read fr,dr:iffr=0then80
75 goto70
80 gosub2000
170 gosub1500
180 pokev+4,40:pokev+5,76:pokev+6,240:pokev+7,200:pokev+8,136:pokev+9,116
190 pokev+10,134:pokev+11,52:pokev+12,137:pokev+13,216:pokev+21,126
200 c1=peek(v+30):c2=peek(v+31):x=137:y=216:rx=240:ry=200:bx=40:by=76
210 rem main loop
220 poke2042,p1:p1=p1+1:ifp1=195thenp1=193
230 poke2043,p2:p2=p2+1:ifp2=197thenp2=195
240 jy=peek(56320)and15
250 ifjy=7thenx=x+3
260 ifjy=11thenx=x-3
270 ifjy=13theny=y+3
280 ifjy=14theny=y-3
281 ifjy=10thenx=x-3:y=y-3
282 ifjy=6thenx=x+3:y=y-3
283 ifjy=5thenx=x+3:y=y+3
284 ifjy=9thenx=x-3:y=y+3
286 ifx>244thenx=244
287 ifx<24thenx=24
288 ify>229theny=229
289 ify<50theny=50
290 pokev+12,x:pokev+13,y
300 c1=peek(v+30):ifc1>64then800
310 c2=peek(v+31):ifc2>63then805
320 onlpgosub500,600,700:lp=lp+1:iflp=4thenlp=1
330 goto220
490 rem red dragon movement
500 q1=sgn(x-rx)+2:q2=sgn(y-ry)+2
510 on q1gosub530,530,540:onq2gosub550,550,560
520 ifrx<25thenrx=25
521 ifrx>244thenrx=244
522 ifry<76thenry=76
523 ifry>229thenry=229
525 pokev+6,rx:pokev+7,ry:return
530 rx=rx-sr:return
540 rx=rx+sr:return
550 ry=ry-sr:return
560 ry=ry+sr:return
590 rem blue dragon movement
600 q1=sgn(x-bx)+2:q2=sgn(y-by)+2
610 on q1gosub630,630,640:onq2gosub650,650,660
620 ifbx<25thenbx=25
621 ifbx>244thenbx=244
622 ifby<76thenby=76
623 ifby>229thenby=229
625 pokev+4,bx:pokev+5,by:return
630 bx=bx-sb:return
640 bx=bx+sb:return
650 by=by-sb:return
660 by=by+sb:return
690 rem time
700 tm=tm-10:iftm=0then1000
710 print""tab(33)" ":print""tab(32)tm
720 return
790 rem collisions
800 ifc1>95then900
805 forl=0to24:poke54272+l,0:next
810 pokev+23,14:pokev+29,14:poke2046,198
820 forl=0to8
830 p1=p1+1:ifp1=195thenp1=193
840 p2=p2+1:ifp2=197thenp2=195
850 poke2042,p1:poke2043,p2
860 poke54296,15:poke54277,80:poke54278,243:poke54275,4:poke54276,65
870 forz=20to140step5:poke54273,z:next
875 poke54276,64:next
880 lv=lv-1:print""tab(34)lv:iflv=0then1000
885 pokev+23,2:pokev+29,2:poke2046,192:pokev+21,2:gosub1600:goto180
890 rem save princess
900 pokev+21,99:pokev+10,160:pokev+11,82:pokev+12,120:pokev+13,82
910 sc=sc+100+tm:print""tab(32)sc
920 gosub2500
930 pokev+21,2:gosub1600:goto180
990 rem game over
1000 print"[147]":pokev+21,0:ifsc>hsthenhs=sc
1010 print""tab(12)"g a m e o v e r"
1020 print""tab(14)"score "sc:print:printtab(14)"high score "hs
1030 print""tab(10)"play again - y or n"
1040 print""tab(23)d$
1050 print""tab(8)d$:print""tab(35)d$
1060 get jk$:ifjk$<>""then1060
1070 geti$:ifi$=""then1070
1080 if i$="y"then1100
1090 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
1091 print"[147]":ifer<>63thenend
1092 poke53272,21:load"hello connect",8
1100 sc=0:lv=3:tm=2500:gosub2080:goto170
1490 rem set up playing screen
1500 print"[147]"tab(30)"[144]@[146] dragon!":printtab(30)"@"tab(37)"ab"
1510 printtab(30)"@[146] tcdef":printtab(30)"@[146] ghijklm"
1520 printtab(30)"@[146] nopqrs":printtab(30)"@":printtab(30)"@[146] time"
1530 printtab(30)"@[146]"tab(32)tm:printtab(30)"@":printtab(30)"@[146]"
1540 printtab(30)"@[146]":printtab(30)"@[146] lives"
1550 printtab(30)"@[146]"tab(34)lv:forl=1to6:printtab(30)"@":next
1560 printtab(30)"@[146] score":printtab(30)"@[146]"tab(32)sc:printtab(30)"@"
1570 printtab(30)"@[146] high":printtab(30)"@[146]"tab(32)hs
1580 gosub1600:return
1590 rem erase and draw new forest
1600 print"":forl=1to22:print" ":next
1610 forl=0toint(rnd(9)*20+tz):h=int(rnd(9)*6):co=int(rnd(9)*5)
1620 prints$(co)tab(s(h))tr$:next
1630 print""tab(12)tr$:print""tab(17)tr$
1640 return
2000 poke53272,(peek(53272)and240)or14
2080 poke2040,199:poke2041,197:poke2042,193:poke2043,195:poke2044,201
2082 poke2045,200
2085 poke2046,192:pokev+28,32:pokev+37,1:pokev+38,6:pokev+44,7:pokev+39,2
2090 pokev+40,12:pokev+41,6:pokev+42,2:pokev+43,0:pokev+45,1:pokev+29,2
2095 pokev,144:pokev+1,76:pokev+16,2:pokev+2,26:pokev+3,158:pokev+23,2
2100 rem title screen
2110 poke53281,15:poke53280,0:print"[147]"
2120 printtab(2)"@@@"
2130 print" [144]@@[144]@@[146] nce upon a time,there were two..."
2140 print" [144]@@@@":print" [144]@@@":print""tab(13)"d r a g o n s !"
2150 print:print:printtab(9)"choose your skill level":print
2160 printtab(15)"1-beginner":print:printtab(15)"2-experienced":print
2170 printtab(15)"3-expert":print""tab(22)d$
2180 print""tab(8)d$:print""tab(35)d$
2190 get jk$:ifjk$<>""then2190
2200 geti$:ifi$=""then2200
2210 ifi$="1"thensr=5:sb=4:tz=10:return
2220 ifi$="2"thensr=5:sb=5:tz=15:return
2230 ifi$="3"thensr=6:sb=4:tz=20:return
2240 goto2200
2490 rem song
2500 restore:forl=54272to54296:pokel,0:next
2510 poke54275,8:poke54277,41:poke54278,89:poke54286,117:poke54290,16
2520 poke54296,143
2530 readfr,dr:iffr=0thenreturn
2540 poke54276,65
2560 fq=fr+peek(54299)/2:hf=int(fq/256):lf=fqand255
2570 poke54272,lf:poke54273,hf:forl=1todr*40:next
2580 poke54276,64:goto2530
2900 rem song data
2910 data 5103,8,10207,8,9634,4,7647,2,8583,2,9634,4,10207,4,5103,8,8583,4
2920 data 8583,4,7647,4,7647,4,7647,4,7647,4,4291,8,6812,8,6430,4,5103,2
2930 data 5728,2,6430,4,6812,4,5728,4,4817,2,5103,2,5728,4,6430,4,5103,12
2940 data 0,0